// presented at : http://www.algorithmist.com/index.php/LA_3521
// The formula for finding the sum reminded me about my primary school teacher. His method 
// of memorising this formula is absolutely brilliant.

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	long long i, r, q, m, n, k, res;

	while (cin >> n >> k)
	{
		res = 0;
		if (n > k) {
			res = k * (n-k);
			n = k;
		}
		
		i = 1;
		while (i <= n)
		{
			r = k % i;
			q = k / i;

			m = min(r / q, n-i);
			
			long long start = r-m*q;
			long long end = r;

			long long  ssh = (end - start) / q + 1;
			long long sum = (start + end) * ssh / 2;
			
			res += sum;
			i += m+1;
		}

		cout << res << endl;
	}	
	return 0;
}
